<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Color</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">Color</span><span class="enumValue">.Primary</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">ShowCounter</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Show Counter<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">&gt;</span>
</pre></div>
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code {
    [Inject] <span class="keyword">public</span> IModalService ModalService { <span class="keyword">get</span>; <span class="keyword">set</span>; }

    <span class="keyword">public</span> Task ShowCounter()
    {
        Random random = <span class="keyword">new</span>();
        <span class="keyword">var</span> newValue = random.NextInt64( <span class="number">100</span> );
        <span class="keyword">return</span> ModalService.Show&lt;CounterExample&gt;( <span class="string">&quot;My Custom Content!&quot;</span>, x =&gt; x.Add( x =&gt; x.Value, newValue ) );
    }
}
</pre></div>
</div>
